<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>合同信息</title>
    <link rel="stylesheet" href="/static/crm/lib/layui-v2.6.3/css/layui.css" media="all">

</head>

<body>
    <script src="/static/crm/lib/layui-v2.6.3/layui.js" charset="utf-8"></script>
    <table class="layui-hide" id="currentTableId" lay-filter="currentTableFilter"></table>
    <script type="text/html" id="toolEventDemo">
        <a class="layui-btn  layui-btn-danger layui-btn-sm " lay-event="add" ><i class="layui-icon  layui-icon-edit layui-icon-addition"></i>添加</a>
</script>
    

</body>
</html>
<script>
        layui.use(['laydate', 'jquery', 'form','table'], function () {
        var laydate = layui.laydate;
        var $ = layui.jquery;
        var form = layui.form;
        var table = layui.table;
        table.render({
                elem: '#currentTableId',
                url: 'business',
                toolbar: '#toolbarDemo',
                cols: [[
                    { field: 'id', width: 60, title: 'ID', sort: true },
                    { field: 'name', width: 200, title: '商机名称' },
                    { field: 'client', width: 100, title: '客户名称' },
                    { field: 'sale', title: '线索人', width: 100, sort: true },
                    { field: 'principal', title: '跟进人', width: 130, sort: true },
                    { field: 'money', width: 100, title: '预计金额' },
                    { field: 'predict_time', width: 130, title: '预计成交时间' },
                    { field: 'remark', width: 100, title: '备注', },
                    { field: 'status', 
                    width: 100, 
                    title: '状态' ,
                    templet:function(d){
                        switch (d.status) {
                            case 0:
                            return  '<div style="color:red" >交易中<div>';
                        }
                        
                    }},
                    { title: '操作', minWidth: 100, toolbar: '#toolEventDemo', align: 'center', fixed: 'right' }
                ]],
            });
     });
     
</script>